#include<STC15F2K60S2.H>
#include<INTRINS.H>
void cls_buzz(void)
{
	P2=(P2&0X1F)|0XA0;
	P0=0X00;
	P2=P2&0X1F;
}
void delay(unsigned int xms)		//@11.0592MHz
{
	unsigned char i, j;

	_nop_();
	_nop_();
	_nop_();
	while(xms--)
	{
		i = 11;
		j = 190;
		do
		{
			while (--j);
		} while (--i);
	}
	
}
sbit S4=P3^3;
unsigned int i=0;
void main(void)
{
	cls_buzz();
	
	P2=(P2&0X1F)|0X80;
	P0=0XFF;
	P2=P2&0X1F;
	
	while(1)
	{
			if(S4==0)
		{
			delay(20);
			while(S4==0);
			delay(20);
			
			i++;
			if(i==256)
				i=0;
			P2=(P2&0X1F)|0X80;
			P0=~i;
			P2=P2&0X1F;
			
		}
	}
	
	
	
}